package com.edu.vo;

import java.io.Serializable;
import java.util.List;

import com.edu.exception.FileException;

/**
 * @Title: PageUtils.java
 * @Description: TODO
 * @Author zhu
 * @Date 2017/11/169:30
 * @Annotation 分页工具类
 */
public class PageUtils implements Serializable {


    private static final long serialVersionUID = 1L;
    // 总记录数
    private int total;
    // 列表数据
    private List<?> rows;

    private int code;

    private String message;
    /**
     * 分页
     *
     * @param list
     *            列表数据
     * @param totalCount
     *            总记录数
     * @param pageSize
     *            每页记录数
     * @param currPage
     *            当前页数
     */

    /**
     * 成功的构造函数
     *
     * @param list
     * @param total
     */
    public PageUtils(List<?> list, int total) {
        this.code = ServerConstant.SUCCESS;
        this.rows = list;
        this.total = total;
    }

    /**
     * 异常的构造函数
     *
     * @param code
     * @param e
     */
    public PageUtils(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public List<?> getRows() {
        return rows;
    }

    public void setRows(List<?> rows) {
        this.rows = rows;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }


}